package com.ce.pms.customer.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.ce.pms.common.model.SysInfo;
import com.ce.pms.house.model.HouseDomain;
import com.sitechasia.webx.core.model.IDomainObject;
import com.sitechasia.webx.core.model.IValueObjectValidator;
/**
 * 实体名称：居住历史 关联表:CS_RESIDE_IN_HIS
 *
 * @author Adama Yue
 */
@Entity
@Table(name="CS_RESIDE_IN_HIS")
public class ResidentInHisDO implements IDomainObject, IValueObjectValidator{
	@Id
	@GeneratedValue
	@Column(name = "RESIDE_IN_HIS_ID")
	private Long residentInHisId;
	@ManyToOne(cascade={},fetch=FetchType.LAZY)
	@JoinColumn(name="CLIENT_ID",nullable=false)
	private ClientDO client;//客户
	@ManyToOne(cascade={},fetch=FetchType.LAZY)
	@JoinColumn(name="HOUSE_ID",nullable=false)
	private HouseDomain house;//房屋

	@Temporal(TemporalType.DATE)
	@Column(name="IN_DATE")
	private Date inDate;//入住日期
	@Temporal(TemporalType.DATE)
	@Column(name="OUT_DATE")
	private Date outDate;//搬出日期

	@Embedded
	private SysInfo sysInfo;

	public ResidentInHisDO() {
	}
	/**
	 * mini constructor
	 * @param client 客户
	 * @param house  房屋
	 */
	public ResidentInHisDO(ClientDO client, HouseDomain house, SysInfo sysInfo) {
		super();
		this.client = client;
		this.house = house;
		this.sysInfo = sysInfo;
	}
	/**************************************************
	 * Accessors and Modifiers
	 **************************************************/
	public boolean validate() {
		// TODO Auto-generated method stub
		return false;
	}
	public ClientDO getClient() {
		return client;
	}
	public void setClient(ClientDO client) {
		this.client = client;
	}
	public HouseDomain getHouse() {
		return house;
	}
	public void setHouse(HouseDomain house) {
		this.house = house;
	}
	public Date getInDate() {
		return inDate;
	}
	public void setInDate(Date inDate) {
		this.inDate = inDate;
	}
	public Date getOutDate() {
		return outDate;
	}
	public void setOutDate(Date outDate) {
		this.outDate = outDate;
	}
	public Long getResidentInHisId() {
		return residentInHisId;
	}
	public void setResidentInHisId(Long residentInHisId) {
		this.residentInHisId = residentInHisId;
	}
	public SysInfo getSysInfo() {
		return sysInfo;
	}
	public void setSysInfo(SysInfo sysInfo) {
		this.sysInfo = sysInfo;
	}



}
